package com.heima.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.heima.pojo.entity.VendingMachine;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

@Mapper
public interface VendingMachineMapper extends BaseMapper<VendingMachine> {
    /**
     * 添加设备
     * @param vendingMachine
     * @return
     */
    Boolean add(VendingMachine vendingMachine);

    /**
     * 查询最大的innerCode值
     * @return 最大的innerCode字符串
     */
    @Select("SELECT inner_code FROM tb_vending_machine ORDER BY CAST(inner_code AS UNSIGNED) DESC LIMIT 1")
    String selectMaxInnerCode();

}
